/**
 * 							RTC Defination
 * @brief	RTC Definaton
 * @author	chy.
 * @note
 * @comment	this file defines macros and functions used by common time module!
 */
#ifndef _K_DRIV_RTC_S3C2440_H_
#define	_K_DRIV_RTC_S3C2440_H_

#include "k_rtc_common.h"
#include "k_io_basedefine.h"

// registers address
#define	R_LTPLL		(*(unsigned int *)K_IO_PHYPORT2VIRPORT(0x4C000000))
#defien	R_MPLLCON	(*(unsigned int *)K_IO_PHYPORT2VIRPORT(0x4C000004))
#define	R_UPLLCON	(*(unsigned int *)K_IO_PHYPORT2VIRPORT(0x4C000008))
#define	R_CLKCON	(*(unsigned int *)K_IO_PHYPORT2VIRPORT(0x4C00000C))
#define	R_CLKSLOW	(*(unsigned int *)K_IO_PHYPORT2VIRPORT(0x4C000010))
#define	R_CLKDIVN	(*(unsigned int *)K_IO_PHYPORT2VIRPORT(0x4C000014))
#define	R_CAMDIVN	(*(unsigned int *)K_IO_PHYPORT2VIRPORT(0x4C000018))

/**
 * @BRIEF	:	Initialize RTC
 * @PARAM	:	void
 * @RETURN	:	void
 * @NOTE	:	The hard rtc is different in different platform.
 */
void k_driv_s3c2440_rtc_init(void);


/**
 * @BRIEF	:	Set RTC Value
 * @PARAM	:	time time value
 * @RETURN	:	0 failed, other success
 * @NOTE	:	this function will igore week field in K_Time structure
 */
unsigned int k_driv_rtc_set(K_Time *time);


#endif	/* _K_DRIV_RTC_S3C2440_H_ */